package com.share.user.api.factory;

import com.share.common.core.exception.ServiceException;
import com.share.system.api.factory.RemoteUserFallbackFactory;
import com.share.user.api.RemoteUserInfoService;
import com.share.user.api.domain.UpdateUserLogin;
import com.share.user.api.domain.UserInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import com.share.common.core.domain.R;


/**
 * 用户服务降级处理
 *
 * @author share
 */
@Component
public class RemoteUserInfoFallbackFactory implements FallbackFactory<RemoteUserInfoService> {

    private static final Logger log = LoggerFactory.getLogger(RemoteUserFallbackFactory.class);

    @Override
    public RemoteUserInfoService create(Throwable cause) {
        cause.printStackTrace();
        throw new ServiceException("远程调用失败");
    }
}
